<?php
$userid = islogin();
$oOrder = new Order();
$r = $oOrder->add_to_order($_POST);

if($r['result'] == 'succ'){
	$vars['orderinfo'] = $r['orderinfo'];
	// 配送方式
	$deliverys = cache_read('deliverys.php');
	$vars['deliveryinfo'] = $deliverys[$r['orderinfo']['delivery']];
	
	// 支付方式
	$payments = cache_read('payments.php');
	$vars['paymentinfo'] = $payments[$r['orderinfo']['payment']];

}else{
	$vars['errmsg'] = $r['rmsg'];
}
$vars['result'] = $r['result'];
?>